﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ModuleDALCore;
using System.Data;
using DTO;

namespace DAL
{
	public class CT_TOAMAUTHUOCDAO:DALBase
	{
		public CT_TOAMAUTHUOCDAO()
		{
			this.OpenConnect();
		}
		private DataTable dt;
		private string _SpName;

		public string SpName
		{
			get { return "SPCT_TOAMAUTHUOC"; }
			set { _SpName = value; }
		}
		public DataTable GetListBC(CT_TOAMAUTHUOC ct)
		{
			dt = new DataTable();
			try
			{

				dt = DBManager.Intance.ExecuteDataTable(SpName, ConvertClassToArray.GetParamName(ct, null), ConvertClassToArray.GetValues(ct, 0));
				return dt;
			}
			catch { return null; }
		}
		public List<CT_TOAMAUTHUOC> GetListTM(CT_TOAMAUTHUOC ct)
		{
			dt = new DataTable();
			List<CT_TOAMAUTHUOC> ds = new List<CT_TOAMAUTHUOC>();
			try
			{

				dt = DBManager.Intance.ExecuteDataTable(SpName, ConvertClassToArray.GetParamName(ct, null), ConvertClassToArray.GetValues(ct, 0));
				ds = (List<CT_TOAMAUTHUOC>)ConvertDatatableToList.ConvertTo<CT_TOAMAUTHUOC>(dt);
				return ds;
			}
			catch { return null; }
		}
		public String CreatenewId()
		{
			try
			{
				return "";

			}
			catch { return null; }
		}
	}
}
